<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
<button id="btn" onclick="randomContent()" style="width: 250px;height: 50px">提示信息</button>
<!-- 请编写js函数randomContent(),实现: 从一个预定义的数组
(['first_msg','second_msg','third_msg','fourth_msg'])中随机选择一段内容,从而为页面添加随机的提示信息。 -->
<script >
    function randomContent() {
        var arr = ['first_msg','second_msg','third_msg','fourth_msg'];
        var num = Math.floor(Math.random()*arr.length);
        alert(arr[num]);
    }
</script>
</body>
</html>
